import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { store, key } from './store';
import { directive } from '/@/utils/directive';
import { i18n } from '/@/i18n/index';
import { globalComponentSize } from '/@/utils/componentSize';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import '/@/theme/index.scss';
import mitt from 'mitt';
import screenShort from 'vue-web-screen-shot';
import VueGridLayout from 'vue-grid-layout';

import Uploader from '/@/components/vue-simple-uploader/components/uploader.vue'
import UploaderBtn from '/@/components/vue-simple-uploader/components/btn.vue'
import UploaderDrop from '/@/components/vue-simple-uploader/components/drop.vue'
import UploaderUnsupport from '/@/components/vue-simple-uploader/components/unsupport.vue'
import UploaderList from '/@/components/vue-simple-uploader/components/list.vue'
import UploaderFiles from '/@/components/vue-simple-uploader/components/files.vue'
import UploaderFile from '/@/components/vue-simple-uploader/components/file.vue'

import "./tailwind.css";
import VoiceRecordUnit from './utils/shf/VoiceRecordUnit';

import moment from 'moment'//导入文件
import GlobalConfig from './utils/config/GlobalConfig';
import UpswarnData from './utils/config/UpswarnData';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';



moment.locale('zh-cn');//需要汉化

GlobalConfig.moment = moment;

UpswarnData.init();

window["momentG"] = moment;

VoiceRecordUnit.init();

const app = createApp(App);

app.component(Uploader.name, Uploader)
app.component(UploaderBtn.name, UploaderBtn)
app.component(UploaderDrop.name, UploaderDrop)
app.component(UploaderUnsupport.name, UploaderUnsupport)
app.component(UploaderList.name, UploaderList)
app.component(UploaderFiles.name, UploaderFiles)
app.component(UploaderFile.name, UploaderFile)

app
	.use(router)
	.use(store, key)
	.use(ElementPlus, { i18n: i18n.global.t, size: globalComponentSize })
	.use(i18n)
	.use(screenShort, { enableWebRtc: false })
	.use(VueGridLayout)
	.use(Antd)
	.mount('#app');

app.config.globalProperties.mittBus = mitt();

app.config.globalProperties.$timeFormat = (time:string)=>{
	return GlobalConfig.moment(parseInt(time+"")).format('YYYY-MM-DD HH:mm:ss');
  };
directive(app);


